﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.SimulationPerformanceRecorder.CUiSimulationPerformanceRecorderCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.Windows;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.SimulationPerformanceRecorder;

public class CUiSimulationPerformanceRecorderCmd : TxButtonCommand
{
  private CUiSimulationPerformanceRecorderCmdEnabler enabler_ = new CUiSimulationPerformanceRecorderCmdEnabler();
  private static bool m_isOpened;

  public virtual string Name => SimulationPerformanceRecorderStringTable.CMD_NAME;

  public virtual string Bitmap => SimulationPerformanceRecorderStringTable.CMD_ICON;

  public virtual string Category => SimulationPerformanceRecorderStringTable.CMD_CATEGORY;

  public virtual void Execute(object cmdParams)
  {
    if (CUiSimulationPerformanceRecorderCmd.m_isOpened)
      return;
    CUiSimulationPerformanceRecorderWindow performanceRecorderWindow = new CUiSimulationPerformanceRecorderWindow();
    ((Window) performanceRecorderWindow).Closed += new EventHandler(this.spr_Closed);
    CUiSimulationPerformanceRecorderCmd.m_isOpened = true;
    performanceRecorderWindow.ShowDialog(true);
  }

  private void spr_Closed(object sender, EventArgs e)
  {
    CUiSimulationPerformanceRecorderCmd.m_isOpened = false;
  }

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.enabler_;
}
